﻿using NetSurveillance.WebApp.DataServices.Models;
using ServiceStack.OrmLite;

namespace NetSurveillance.WebApp.DataServices.Implementations
{
    public class MonitorSettingService : BaseService<MonitorSetting>
    {
        public MonitorSettingService(string connStr, IOrmLiteDialectProvider provider = null)
            : base(connStr, provider)
        {
        }

        public MonitorSetting GetFirstMonitorSetting()
        {
            MonitorSetting monitorSetting;
            using (var db = DbFactory.OpenDbConnection())
            {
                monitorSetting = db.SingleWhere<MonitorSetting>("StatusToken", 1);
            }
            return monitorSetting;
        }
    }
}